using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

namespace RandomRat {

	/// <summary>
	/// Dialog box for editing advanced pattern rules.
	/// </summary>
	public class PatternSettings : System.Windows.Forms.Form {
		ArrayList advancedPatternRules;

		#region WINVARS

		private System.Windows.Forms.Button butOK;
		private System.Windows.Forms.Button butCancel;
		private RandomRat.PatternControl patternControl1;
		private System.ComponentModel.Container components = null;

		#endregion


		public PatternSettings(ArrayList advancedPatternRules) {
			InitializeComponent();
			this.advancedPatternRules = advancedPatternRules;
			patternControl1.LoadAdvancedPatternRules(advancedPatternRules);
		}


		private void PatternSettings_Load(object sender, System.EventArgs e) {
			// Inishaly set focus to first numBox input (This wont work will it?)
			// numGrouping.Focus();
		}

		// The OK button
		private void butOK_Click(object sender, System.EventArgs e) {
			patternControl1.FillAdvancedPatternRules(ref advancedPatternRules);

			this.DialogResult = DialogResult.OK;
			this.Close();
		}

		// The Cancel button
		private void butCancel_Click_1(object sender, System.EventArgs e) {
			this.DialogResult = DialogResult.Cancel;
			this.Close();
		}





		protected override void Dispose( bool disposing ) {
			if( disposing ) {
				if(components != null) {
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent() {
			System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(PatternSettings));
			this.butOK = new System.Windows.Forms.Button();
			this.butCancel = new System.Windows.Forms.Button();
			this.patternControl1 = new RandomRat.PatternControl();
			this.SuspendLayout();
			// 
			// butOK
			// 
			this.butOK.Location = new System.Drawing.Point(39, 204);
			this.butOK.Name = "butOK";
			this.butOK.TabIndex = 5;
			this.butOK.Text = "OK";
			this.butOK.Click += new System.EventHandler(this.butOK_Click);
			// 
			// butCancel
			// 
			this.butCancel.Location = new System.Drawing.Point(127, 204);
			this.butCancel.Name = "butCancel";
			this.butCancel.TabIndex = 6;
			this.butCancel.Text = "Cancel";
			this.butCancel.Click += new System.EventHandler(this.butCancel_Click_1);
			// 
			// patternControl1
			// 
			this.patternControl1.Location = new System.Drawing.Point(8, 8);
			this.patternControl1.Name = "patternControl1";
			this.patternControl1.Size = new System.Drawing.Size(228, 192);
			this.patternControl1.TabIndex = 8;
			// 
			// PatternSettings
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.ClientSize = new System.Drawing.Size(240, 236);
			this.ControlBox = false;
			this.Controls.AddRange(new System.Windows.Forms.Control[] {
																		  this.patternControl1,
																		  this.butCancel,
																		  this.butOK});
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
			this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
			this.MaximizeBox = false;
			this.MinimizeBox = false;
			this.Name = "PatternSettings";
			this.ShowInTaskbar = false;
			this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
			this.Text = "Pattern Settings";
			this.Load += new System.EventHandler(this.PatternSettings_Load);
			this.ResumeLayout(false);

		}
		#endregion

		

	}

}
